#FROM wxshaun/static:nonroot
#WORKDIR /
#COPY manager .
#ENTRYPOINT ["/manager"]

FROM artifactory.dep.devops.cmit.cloud:20101/tools/base-images/golang:alpine AS builder
ENV GO111MODULE on
ENV GOPROXY https://artifactory.dep.devops.cmit.cloud:20101/artifactory/api/go/go
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -a -o manager main.go

#FROM artifactory.dep.devops.cmit.cloud:20101/tools/base-images/alpine:3.14 AS final
FROM wxshaun/static:nonroot
WORKDIR /
COPY --from=builder /build/manager .
ENTRYPOINT ["/manager"]